<script type="text/javascript">
$(function(){
	var dpmb = {t:null};
	var old_href = location.href ;
	$('li[id^="menu_"]').mouseover(function(){
		var idIndex = $(this).attr("id").substring(5),
			p_top = $(this).offset().top - 70;
		if(idIndex == 30){
			p_top = $(this).offset().top + 50;
		}
		if( $.inArray( idIndex,['24','25','26']) != -1)return false;
		$(this).addClass("bg_ed");
		p_top = Number(idIndex) > 24 ? p_top - 106 :p_top;
		$(".float_con").removeClass("hid");
		$('#float_'+idIndex).removeClass("hid").siblings().addClass("hid");
		$(".float_con").css("top",p_top);
	}).mouseout(function( e ){
		var _self = $(this);
		if( $.inArray( _self.attr("id").substring(5),['24','25','26']) != -1)return false;
		dpmb.t = setTimeout(function(){
			$('#float_'+_self.attr('id').substring(5) ).addClass("hid");
			_self.removeClass("bg_ed");
		},1);
	});

	/** 智能关联推荐的[提交更新] **/
   $("#guanlian_update_btn, #gl_update_btn").click(function(){	
	$.ajax({
		url:"http://li.dpmb.net/guanlian/ajax.htm",
		data:{"act":"update"},
		type:"post",
		cache: false,
		dataType:"json",		
		beforeSend:function(XMLHttpRequest){
			var msg = '<div style="line-height:22px"><br>已提交服务器端安装<br>请稍后查看安装记录!</div>';			
			$("#lockDiv").show();
			$("#waiting").html(msg).show();				
			window.clearTimeout(window.tid);
			window.tid = setTimeout( 
			function(){$("#lockDiv,#waiting").hide('slow');	}, 3000);	
		},
		success:function(data,textStatus){
			$("#lockDiv,#waiting").hide();
			if (data!=undefined) {
				if(data.msg == 'lower_level'){
					$("#dpmb_msg").html("<p style='font-size:14px'><br><span class='ui-icon ui-icon-alert' style='float:left; margin:0 7px 30px 20px;'></span>"+data.sub_msg+"</p>");
					$("#dpmb_msg").dialog({title:'权限不足',height:200,width:400,position:'center',resizable: false,modal: true,buttons: {
						"返回": function() {parent.$( this ).dialog( "close" );},
						"立即升级": function() {
							window.open('http://fuwu.taobao.com/ser/detail.htm?service_id=11727&trace=gl_update_index');
						}
						}, close:function(){$("#dpmb_msg").dialog( "destroy" );}						
					});
				}else{ 			
					$("#dpmb_msg").html("<p style='font-size:14px'><br><span class='ui-icon ui-icon-alert' style='float:left; margin:0 7px 30px 10px;'></span>"+data.msg+"</p>");
					$("#dpmb_msg").dialog({title:'系统提醒',height:200,width:400,resizable: false,modal: true, 
						buttons: {"返回": function() {$( this ).dialog( "close" ) }}
					});	
				}		
			}		
		}						
	});
  });	

/** 智能关联推荐的[取消推荐] **/
  $("#guanlian_del_btn, #gl_del_btn").click(function(){
	$.ajax({
		url:"http://li.dpmb.net/guanlian/ajax.htm",
		data:{"act":"uninstall"},
		type:"post",
		cache: false,
		dataType:"json",		
		beforeSend:function(XMLHttpRequest){
			var msg = '<div style="line-height:22px"><br>已提交服务器端取消<br>请稍后查看操作记录!</div>';			
			$("#lockDiv").show();
			$("#waiting").html(msg).show();				
			window.clearTimeout(window.tid);
			window.tid = setTimeout( 
			function(){$("#lockDiv,#waiting").hide('slow');	}, 3000);	
		},
		success:function(data,textStatus){
			$("#lockDiv,#waiting").hide();
			if (data!=undefined) {
				if(data.msg == 'lower_level'){
					$("#dpmb_msg").html("<p style='font-size:14px'><br><span class='ui-icon ui-icon-alert' style='float:left; margin:0 7px 30px 20px;'></span>"+data.sub_msg+"</p>");
					$("#dpmb_msg").dialog({title:'权限不足',height:200,width:400,position:'center',resizable: false,modal: true,buttons: {
						"返回": function() {parent.$( this ).dialog( "close" );},
						"立即升级": function() {
							window.open('http://fuwu.taobao.com/ser/detail.htm?service_id=11727&trace=gl_update_index');
						}
						}, close:function(){$("#dpmb_msg").dialog( "destroy" );}						
					});
				}else{ 			
					$("#dpmb_msg").html("<p style='font-size:14px'><br><span class='ui-icon ui-icon-alert' style='float:left; margin:0 7px 30px 10px;'></span>"+data.msg+"</p>");
					$("#dpmb_msg").dialog({title:'系统提醒',height:200,width:400,resizable: false,modal: true, 
						buttons: {"返回": function() {$( this ).dialog( "close" ) }}
					});	
				}		
			}		
		}
	});		
  });


	$('div[id^="float_"]').live("mouseleave",function(){
		$(this).addClass('hid');
		$('li[id^="menu_"]').removeClass("bg_ed").find("span").removeAttr("style");
	}).live("mouseenter",function(){
		clearTimeout( dpmb.t );
		// dpmb.t = null;
		var idIndex = $(this).attr("id").substring(6);
		$('#menu_'+idIndex).addClass("bg_ed").find("span").css("color","#1f6fad");
	});
	$(".zhedie").mouseover(function(){
		$('div[id^="float_"]').addClass("hid");
	});
	$(".zhedie").toggle(
		function(){
			$(this).siblings().hide();
			$(this).find("span").text("+");
		},
		function(){
			$(this).siblings().show();
			$(this).find("span").text("-");
		}
	);
	$(".lb_item_con").mouseover(function(){
		$(this).find("a").css("cursor","pointer");
	});
	$(".menu_first").click(function(){
		location.href = 'http://li.dpmb.net' ;
	});
	
	$(".lb_item").live('mouseover',function(){
//		$('div[id^="#lb_thumb_"]').addClass("hid");
		var picIndex = $(this).parent().parent().index();
		$('div[id^="lb_thumb_"]').hide();
		$('#lb_thumb_'+picIndex).fadeIn(1000);
		$('#lb_thumb_'+picIndex).siblings().hide();
	});
	
	$(".muban_item_con:lt(7)").live("mouseover",function(){
		var picIndex = $(this).index();
		$('div[id^="xq_thumb_"]').hide();
		$('#xq_thumb_'+picIndex).fadeIn(1000);
		$('#xq_thumb_'+picIndex).siblings().hide();
	});
	$("#toshow_").show();	
});
</script>